package cn.airia.as3wplib.service
{
	public interface IBloggerService
	{
		/**
		 * Retrieve the blogs of the users
		 * @param username 
		 * @param password 
		 * @param retFun Array
		 * element type:Object
		 * 	<ul>
		 * 		<li>bool isAdmin</li>
		 * 		<li>string url</li>
		 * 		<li>int blogid</li>
		 * 		<li>string blogName</li>
		 * 		<li>string xmlrpc</li>
		 * 	</ul>
		 * 
		 */		
		function getUsersBlogs(username:String,password:String,retFun:Function):void;
		
		/**
		 *  
		 * @param username 
		 * @param password 
		 * @param retFun Array
		 * element type:Object
		 * 	<ul>
		 * 		<li>string nickname</li>
		 * 		<li>int userid</li>
		 * 		<li>string url</li>
		 * 		<li>string lastname</li>
		 * 		<li>string firstname</li>
		 * 	</ul>
		 */		
		function getUserInfo(username:String,password:String,retFun:Function):void;
		/**
		 * @param post_id 
		 * @param username 
		 * @param password 
		 * @param retFun Object
		 * 	<ul>
		 * 		<li>string content</li>
		 * 		<li>date dateCreated</li>
		 * 		<li>int postid</li>
		 * 		<li>int userid</li>
		 * 	</ul>
		 */	
		function getPost(post_id:int,username:String,password:String,retFun:Function):void;
		
		/**
		 * @param post_id 
		 * @param username 
		 * @param password 
		 * @param num_posts 
		 * @param retFun Array
		 * element type:Object
		 * <ul>
		 * 		<li>string content</li>
		 * 		<li>date dateCreated</li>
		 * 		<li>int postid</li>
		 * 		<li>int userid</li>
		 * 	</ul>
		 */	
		function getRecentPosts(blog_id:int,username:String,password:String,num_posts:int,retFun:Function):void;
		/**
		 * this operation is not working correctly
		 */
		function getTemplate(blog_id:int,username:String,password:String,template:String,retFun:Function):void;
		/**
		 * this operation is not working correctly
		 */
		function setTemplate(blog_id:int,username:String,password:String,template:String,content:Object,retFun:Function):void;
		/**
		 * @param blog_id 
		 * @param username 
		 * @param password 
		 * @param content 
		 * content's html format string as below
		 * <br/>
		 * &lt;title&gt;my post title&lt;/title&gt;
		 * <br/>
		 * &lt;category&gt;category_id1,category_id2,... &lt;/category&gt; 
		 * <br/>
		 * &lt;content&gt;my post content...&lt;/content&gt;
		 * @param publish Boolean
		 * @param retFun int (post_id)
		 */	
		function newPost(blog_id:int,username:String,password:String,content:String,publish:Boolean,retFun:Function):void;
		/**
		 * @param post_id 
		 * @param username 
		 * @param password 
		 * @param content 
		 * content's html format string as below
		 * <br/>
		 * &lt;title&gt;my post title&lt;/title&gt;
		 * <br/>
		 * &lt;category&gt;category_id1,category_id2,... &lt;/category&gt; 
		 * <br/>
		 * &lt;content&gt;my post content...&lt;/content&gt;
		 * @param publish 
		 * @param retFun bool
		 */	
		function editPost(post_id:int,username:String,password:String,content:Object,publish:Boolean,retFun:Function):void;
		
		/**
		 * @param post_id 
		 * @param username 
		 * @param password 
		 * @param publish 
		 * @param retFun bool
		 */	
		function deletePost(post_id:int,username:String,password:String,publish:Boolean,retFun:Function):void;
	}
}